package com.sharding.config;

import com.jiao.autoconfig.config.CacheDataSource;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

import javax.sql.DataSource;

/**
 * @Description
 * @Author Vincent.jiao
 * @Date 2022/5/26 11:04
 */
//@Configuration
public class DataSourceConfig {
//    @Primary
//    @Bean
//    public DataSource getDataSource() throws ClassNotFoundException {
//        CacheDataSource cacheDataSource = new CacheDataSource("com.alibaba.druid.pool.DruidDataSource");
//        cacheDataSource.setUsername("root");
//        cacheDataSource.setPassword("123456");
//        cacheDataSource.setDriverClassName("com.mysql.jdbc.Driver");
//        cacheDataSource.setJdbcUrl("jdbc:mysql://127.0.0.1:3306/jiao?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=convertToNull");
//
//        return cacheDataSource;
//    }
}
